==========================================================
 VaM Offscreen Optimizer 1.4.2
 Installation guide (EN)
==========================================================

What it is
----------
A BepInEx plugin for Virt-A-Mate 1.21.x. It stops work on
whatever is not visible on screen and resumes it as soon as
the object comes back into view:

  * character / clothing skinning (DAZSkinV2);
  * hair simulation (GPUTools HairSettings);
  * cloth simulation (GPUTools ClothSettings);
  * soft body physics (DAZPhysicsMesh);
  * particle systems;
  * character shadows (optional, off by default);
  * shadow maps of point and spot lights.

A character's visibility is decided by exactly three of its
controls — hipControl, chestControl and headControl — and only
by the camera frustum: distance to the camera plays no role.
A character outside the frame is culled at any distance; a
character inside the frame stays active at any distance, even
right in front of the camera.

Works in desktop mode and VR. Mirrors are taken into account:
if a character is visible only in a reflection, it keeps
simulating. The plugin does not patch the render pipeline and
does not modify prefs.json or scene files; everything is
restored on unload, scene load and scene save.


Requirements
------------
  * Virt-A-Mate 1.21.x
  * BepInEx 5 


Installation
------------------------
1. Open your game folder

2. Go to:
   BepInEx\plugins\

3. Create a folder there (if it does not exist yet):
   VaMOffscreenOptimizer

4. Copy into it:
   VaMOffscreenOptimizer.dll

   The result should look like this:
   <VaM>\BepInEx\plugins\VaMOffscreenOptimizer\VaMOffscreenOptimizer.dll

5. Start VaM as usual.


Hotkeys
-------
  F8 — show/hide the settings panel.
  F6 — toggle all culling on the fly
       (everything is restored immediately when turned off).

Panel tabs: "Culling" (this plugin) and "Interface" (position,
size and hotkeys). The panel language is switched with the
EN/RU button in the panel header.

On the "Culling" tab: per-category FOV margins (step 0.5°,
range -10...+30°) and category checkboxes.


Main settings (config file)
---------------------------
  [General]
  Enabled = false              — disable the plugin completely

  [Culling]
  HideDelaySeconds = 0.05      — delay before culling
  CullSkins / CullHair / CullCloth / CullSoftBody = true
  CullParticles = true
  CullCharacterShadows = false — character shadows (optional)
  CullLightShadows = true      — light source shadows

  [Frustum]
  FovMarginDegrees = 2         — horizontal margin (degrees)
  FovMarginVerticalDegrees = 2 — vertical margin (degrees)
  Negative values narrow the frame (culling starts before the
  screen edge). Every category can have its own margin;
  -1 means "same as the default".

If objects flicker at the frame edge, raise the FOV margins
(up to 4-6) rather than HideDelaySeconds.

Full settings reference — in README.md.


Uninstall
---------
Delete the folder:
  <VaM>\BepInEx\plugins\VaMOffscreenOptimizer

The config can be kept or removed separately:
  <VaM>\BepInEx\config\org.vam.offscreenoptimizer.cfg

The plugin leaves no traces in prefs.json or scene files.


Files in this folder
--------------------
  VaMOffscreenOptimizer.dll  — the plugin (copy this into the game)
  INSTALL_EN.txt             — this guide
  README.md                  — full documentation (EN)
  SHA256.txt                 — checksum of the DLL
  source\                    — sources and build.ps1


Compatibility
-------------
  VaM GPU Optimizer — independent; no shared panel.
  VaM DLSS / Neural Rendering — no conflicts.
  Anti Stutter Patch 3.0 — independent.
  SkinMeshPartDLL — independent.
